package main

import (
	"fmt"
)

//冒泡排序
func bubblesort(arr []int) {
	if len(arr) <= 1 {
		// return arr
	} else {
		alen := len(arr)
		var tmp int
		for i := 0; i < alen; i++ {
			for j := i + 1; j < alen; j++ {
				if arr[i] > arr[j] {
					tmp = arr[i]
					arr[i] = arr[j]
					arr[j] = tmp
				}
			}
			fmt.Println(arr)
		}

	}
}

func main() {
	arr := []int{3, 5, 4, 2, 9, 6, 78, 9, 10}
	bubblesort(arr)
}
